# Instructions to the compiler and options
CC = g++
RM = rm
CFLAGS = -Wall
# Macro definition
CFLAGS += $(DEFS)
# The target file  
TARGET = $(notdir $(abspath $(CURDIR)/..))
# The source file
DIR_SRC = ../source
SRCS = $(wildcard ${DIR_SRC}/*.cpp)
# The header file search path
INC = -I../source
LIBS = -L./ -lUSB2XXX

# The target file
OBJS = $(SRCS:.cpp=.o)
# Link for the executable file
$(TARGET):$(OBJS)
	$(CC) -o $@ $^ $(LIBS)
	$(RM) -rf $(OBJS) *~
clean:
	$(RM) -rf $(TARGET) $(OBJS) *~

%.o:%.cpp
	$(CC) $(CFLAGS) $(INC) -o $@ -c $<
